The present invention pertains to the field of industrial control or automation. More particularly, the present invention pertains to communication over a network between a programmable logic controller (PLC) for performing a control function relevant to an industrial control or automated system and a computer used for monitoring data associated with the control function and for monitoring control system information in general.
An industrial control system often includes a programmable logic controller (PLC) for providing coordinated control of industrial control equipment, which includes various elements, that are often either sensors for providing inputs to the PLC or relays for receiving outputs from the PLC, each under the control of an element controller, and each connected to the PLC over a network via a network I/O device. Industrial control using a PLC requires what is termed rapid scanning, meaning the continuous, rapid execution by the PLC of three main steps executed repeatedly: the acquiring of the status of each input to the PLC needed to execute so-called ladder logic for the process being controlled, the solving of the ladder logic to determine each output, and the updating of the status of the outputs.
The term ladder logic is used to indicate, in a form recognizable to early workers in the field of machine control, the expression of how the control elements of an industrial control system are to be controlled based on the monitoring elements of the industrial control system. The term ladder is used because the expression of the control logic is actually often in the form of a ladder, with each rung of the ladder having an output, i.e. a value for the required state of a control element, and one or more inputs, i.e. values corresponding to signals from monitoring elements.
For effective industrial control, a PLC must perform its scan of the connected I/O devices at a constant scan rate, never becoming so involved in peripheral tasks as to depart from its regularly scheduled monitoring of the I/O devices.
Ordinarily, process operation is monitored, at least intermittently, by supervisory personnel by means of one or more central management stations. Each station samples the status of PLCs (and their associated sensors) selected by the operator and presents the data in some meaningful format. The management station may or may not be located on the same site as the monitored equipment; frequently, one central station has access to multiple sites (whether or not these perform related processes). Accordingly, communication linkage can be vital even in traditional industrial environments where process equipment is physically proximate, since at least some supervisory personnel may not be.
To facilitate the necessary communication, the PLCs and related monitoring stations are connected by a computer network. Typically, a network is organized such that any computer may communicate with any other network computer. The communication protocol provides a mechanism by which messages can be decomposed and routed to a destination computer identified by some form of address. The protocol may place a xe2x80x9cheaderxe2x80x9d of routing information on each component of a message that specifies source and destination addresses, and identifies the component to facilitate later reconstruction of the entire message by the destination computer. This approach to data transfer permits the network to rapidly and efficiently handle large communication volumes without reducing transfer speed in order to accommodate long individual messages, or requiring every network computer to process every network message. The degree of routing depends on the size of the network. Each computer of a local network typically examines the header of every message to detect matches to that computer""s identifier; multiple-network systems use routing information to first direct message components to the proper network.
PLCs have been interconnected by means of computer networks for some time; see, e.g., U.S. Pat. No. 5,307,463. In typical systems, a monitoring computer, which may be remotely located from any or all of the PLCs to which it has access, periodically queries the PLCs to obtain data descriptive of the controlled process or machine, or the PLC itself. These data are then available for analysis by the monitoring computer.
U.S. Pat. No. 5,805,442 discloses what is called a distributed interface that allows a remote computer to obtain information from a PLC over the Internet, the information obtained from the PLC including both data and instructions as to how to display the data (the terminology xe2x80x9cdistributed interfacexe2x80x9d thus being used because at least some of the instructions for displaying data from PLCs are located at the PLCs, not at the remote computer, and communicated to the remote computer with the data to be displayed). The PLC disclosed therein incorporates a web server, i.e. a module that responds to a request for data received over the Internet by providing the data as well as the instructions for displaying the data, the combination of data and display instructions residing on one or another PLC storage device as a so-called web page. What is not disclosed, however, is logic by which the PLC can keep a constant scan rate of its attached I/O devices.
What is needed is a way to incorporate a web server in a PLC in such a way that the PLC scan rate is not affected by the web server responding to requests by a remote computer for data from the PLC.
Accordingly, the present invention provides a controller as part of an industrial control or automated system and a corresponding method, the controller for controlling one or more input/output devices, the controller capable of interacting with a remotely located computer via a network, such as the Internet, the controller including: means for executing a controller scan (including solving ladder logic associated with the input/output devices, the controller scan having a predetermined scan rate; a web server for gathering data relevant to a control function, the web pages comprising data and associated instructions retrievable and executable by the remotely located computer, the instructions causing the remotely located computer to present the data for display in a predetermined format; wherein in response to a request for data, the web server provides one or more web pages in which the requested data are display.
In a further aspect of the invention, the means for gathering data executes as a background task.
In another, further aspect of the invention, the means for gathering data executes in parallel with the means for executing the controller scan.
In yet another, further aspect of the invention, in response to a request for data from the remote computer, the means for gathering data provides no more than a predetermined maximum number of bytes of combined data and instructions per scan by the means for executing the controller scan. In some applications according to this further aspect of the invention, the maximum number of bytes per scan is predetermined to be a number of bytes that can be communicated to the network for delivery to the remote computer in less than the time required for one scan by the means for executing the controller scan.
In still yet another, further aspect of the invention, at least some of the data are resident on a different controller, the data-gathering means being configured to access and obtain the data from the different controller via a computer network.
In still yet even another, further aspect of the invention, the controller further comprises a transmission control program (TCP)/ Internet protocol (IP) stack customized to communicate any MODBUS command or message as a single TCP/IP packet. In some applications according to this further aspect of the invention, the web server comprises a file server for providing the web pages, a hypertext transfer protocol (HTTP) server providing file get functionality, and also in some applications a file transfer protocol (FTP) server for receiving new or replacement web pages over the network via the TCP/IP stack and provides them to the file server.